<template>
    <el-dialog v-model="visible" title="预览" @close="cancel" width="80%">
      <div v-html="templateHtml"></div>
    </el-dialog>
  </template>
  
  <script setup lang="ts">
  import { reactive, ref } from 'vue'
  import { ElMessage } from 'element-plus/es'
  import { addPColumn, addSColumn, editPColumn, editSColumn } from '@/api/allApi'
  const emit = defineEmits(['recover']) //子组件调父组件方法
  
  const visible = ref(false)
  const templateHtml = ref('')
  
  const init = (param: string) => {
      visible.value = true
      console.log(param,"param");
      
      templateHtml.value = param
  }
  const cancel = () => {
      visible.value = false
      emit('recover')
  }
  
  defineExpose({
      init
  })
  </script>
  